package com.liujun.spring4.demo.aop.aop.introductionInterceptor;

/**
 * 性能监控的代码实现
 *
 * @author liujun
 * @version 0.0.1
 * @date 2018/09/17
 */
public class PerformanceMonitor {

  private static ThreadLocal<MethodPreformance> performanceRecord = new ThreadLocal<>();

  public static void begin(String method) {
    System.out.println("begin monitor");
    MethodPreformance mp = new MethodPreformance(method);
    performanceRecord.set(mp);
  }

  public static void end() {
    System.out.println("end monitor....");
    performanceRecord.get().printPerform();
  }
}
